﻿//-----------------------------------------------------------------------
// <copyright file="Trkseg.cs" company="MKCoolsoft">
//     Copyright (c) mkcoolsoft. All rights reserved.
// </copyright>
// <author>Mario Kuhl</author>
// <revision>26.01.2014 Initial version</revision>
//-----------------------------------------------------------------------

namespace MKCoolsoft.GPXLib
{
    #region usings

    using System;
    using System.Collections.Generic;
    using System.Xml.Serialization;

    #endregion usings

    /// <summary>
    /// A Track Segment holds a list of Track Points which are logically 
    /// connected in order. To represent a single GPS track where GPS reception was lost, 
    /// or the GPS receiver was turned off, start a new Track Segment for each 
    /// continuous span of track data. 
    /// </summary>
    public class Trkseg
    {
        #region private fields

        /// <summary>
        /// A Track Point holds the coordinates, elevation, timestamp, and 
        /// metadata for a single point in a track.
        /// </summary>
        private List<Wpt> trkptListField;

        /// <summary>
        /// You can add extend GPX by adding your own elements from another schema here.
        /// </summary>
        private Extensions extensionsField;

        #endregion private fields

        #region contructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Trkseg"/> class.
        /// </summary>
        public Trkseg()
        {
            this.extensionsField = new Extensions();
            this.trkptListField = new List<Wpt>();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Trkseg"/> class.
        /// This "private" constructor is for hiding the public constructor for 
        /// serialize / deserialize
        /// </summary>
        /// <param name="dummy">This is a dummy parameter.</param>
        private Trkseg(int dummy)
        { 
        }

        #endregion contructors

        #region public properties

        /// <summary>
        /// Gets or sets the track point list.
        /// </summary>
        [XmlElementAttribute("trkpt")]
        public List<Wpt> TrkptList
        {
            get
            {
                return this.trkptListField;
            }

            set
            {
                this.trkptListField = value;
            }
        }

        /// <summary>
        /// Gets or sets the extension of the track segment.
        /// </summary>
        public Extensions Extensions
        {
            get
            {
                return this.extensionsField;
            }

            set
            {
                this.extensionsField = value;
            }
        }

        #endregion public properties
    }
}
